import { createRouter,createWebHashHistory } from "vue-router"

const routes =[
    {
        path:'/',  
        redirect:'/login'
    },
    {
        path:'/login',   //登录页
        name:'login',  
        component:()=>import('../views/login/loginView.vue')
    },
    {
        path:'/home',   //布局页
        name:'home',  
        component:()=>import('../components/layout/layoutView.vue'),
        children:[
            {
                path:'/index',   //首页
                name:'index',  
                redirect:'/index/interest',
                component:()=>import('../views/index/indexView.vue'),
                children:[
                    {
                        path:'/index/interest',   //关注页
                        name:'interest',  
                        component:()=>import('../views/index/interest/interestView.vue')
                    },
                    {
                        path:'/index/recommend',   //推荐
                        name:'recommend',  
                        component:()=>import('../views/index/recommend/recommendView.vue')
                    },
                    {
                        path:'/index/hotlist',   //热榜
                        name:'hotlist',  
                        component:()=>import('../views/index/hotlist/hotlistView.vue')
                    },
                    {
                        path:'index/search', //搜索
                        name:'search',  
                        component:()=>import('../views/index/searchView.vue')
                    }
                   
                ]
            },
            {
                path:'/education',   //知乎知学堂
                name:'education',  
                component:()=>import('../views/education/educationView.vue')

            },
            {
                path:'/user',   //用户
                name:'user',  
                component:()=>import('../views/user/userView.vue'),
    
            },

            {
                path:'/usermsg/:id',   //用户展示
                name:'usermsg',  
                component:()=>import('../views/user/usermsgView.vue')
            },
            
            {
                path:'/details/:id',   //详情页
                name:'details',  
                component:()=>import('../views/details/detailsView.vue')
            },
            {
                path:'/search', //搜索
                name:'search',  
                component:()=>import('../views/index/searchView.vue')
            },
            {
                path:'/explore', //可视化
                name:'explore',  
                component:()=>import('../views/explore/exploreView.vue')
                
                
            }
            ,
            {
                path:'/allexplore', //可视化
                name:'allexplore',  
                component:()=>import('../views/explore/allexploreView.vue'),
                children:[
                    {
                        path:'/allexplore/leftup',   //关注页
                        name:'leftup',  
                        component:()=>import('../views/explore/allshows/leftupView.vue')
                    },
                    {
                        path:'/allexplore/leftdown',   //关注页
                        name:'leftdown',  
                        component:()=>import('../views/explore/allshows/leftdownView.vue')
                    },
                    {
                        path:'/allexplore/map_up',   //关注页
                        name:'map_up',  
                        component:()=>import('../views/explore/allshows/mapView_up.vue')
                    },
                    {
                        path:'/allexplore/map_down',   //关注页
                        name:'map_down',  
                        component:()=>import('../views/explore/allshows/mapView_down.vue')
                    },
                    {
                        path:'/allexplore/rightup',   //关注页
                        name:'rightup',  
                        component:()=>import('../views/explore/allshows/rightupView.vue')
                    },
                    {
                        path:'/allexplore/rightdown',   //关注页
                        name:'rightdown',  
                        component:()=>import('../views/explore/allshows/rightdownView.vue')
                    },
                   
                ]
                
            }
            ,
            {
                path:'/topicdetails/:id', //话题详情页
                name:'topicdetails',  
                component:()=>import('../views/index/topicdetailView.vue')
            }
        
        ]
    }, 
]

const router = createRouter ({
    history: createWebHashHistory(),
    routes
})
export default router